package org.example.practice.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.example.commonapi.domain.CollectPractice;
import org.example.commonapi.mapper.CollectPracticeMapper;
import org.example.practice.service.CollectPracticeService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
* @author DELL
* @description 针对表【user_practice(收藏表)】的数据库操作Service实现
* @createDate 2024-06-01 18:04:18
*/
@Service
public class CollectPracticeServiceImpl extends ServiceImpl<CollectPracticeMapper, CollectPractice>
    implements CollectPracticeService {

    @Resource
    private CollectPracticeMapper collectPracticeMapper;

    /**
     * 用户收藏题目
     * @param userId
     * @param practiceId
     */
    @Override
    public void collect(Long userId, Long practiceId) {
        collectPracticeMapper.insert(new CollectPractice(userId, practiceId));
    }


}




